﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace MainService.ZNQD
{
    /// <summary>
    /// 解决方案描述
    /// </summary>
    [XmlRoot("System")]
    public class SolutionInfo
    {
        [XmlAttribute("copyright")]
        public string copyright { get; set; }
        [XmlAttribute("functionModelid")]
        public string functionModelid { get; set; }
        [XmlAttribute("version")]
        public string version { get; set; }
        [XmlAttribute("sysTitle")]
        public string sysTitle { get; set; }
        [XmlAttribute("enName")]
        public string enName { get; set; }
        [XmlAttribute("cnName")]
        public string cnName { get; set; }
        [XmlAttribute("serieId")]
        public string serieId { get; set; }
        [XmlAttribute("id")]
        public string id { get; set; }
        [XmlElement("appliactionInfo")]
        public ApplicationInfo applicationInfo { get; set; }
        [XmlArray("activityInfos")]
        [XmlArrayItem("activityInfo")]
        public List<ActivityInfo> activityInfos { get; set; }
        [XmlArray("menus")]
        [XmlArrayItem("menu")]
        public List<Menu> menus { get; set; }
    }

    public class ApplicationInfo 
    {
        [XmlAttribute("enName")]
        public string enName { get; set; }
        [XmlAttribute("pid")]
        public string pid { get; set; }
        [XmlAttribute("id")]
        public string id { get; set; }
        [XmlElement("cnName")]
        public string cnName { get; set; }
        [XmlElement("jsPath")]
        public string jsPath { get; set; }
        [XmlElement("cssPath")]
        public string cssPath { get; set; }
        [XmlElement("imgPath")]
        public string imgPath { get; set; }
        [XmlElement("resPath")]
        public string resPath { get; set; }
    }

    public class ActivityInfo 
    {
        [XmlAttribute("entityId")]
        public string entityId { get; set; }
        [XmlAttribute("pid")]
        public string pid { get; set; }
        [XmlAttribute("id")]
        public string id { get; set; }
        [XmlElement("cnName")]
        public string cnName { get; set; }
        [XmlElement("enName")]
        public string enName { get; set; }
        [XmlElement("sign")]
        public string sign { get; set; }
        [XmlElement("supEntityId")]
        public string supEntityId { get; set; }
        [XmlElement("tempalteId")]
        public string tempalteId { get; set; }
        [XmlElement("tempalteName")]
        public string tempalteName { get; set; }
        [XmlElement("tempaltePath")]
        public string tempaltePath { get; set; }
        [XmlArray("pcontrollers")]
        [XmlArrayItem("controller")]
        public List<Controller> controllers { get; set; }
        [XmlArray("signInfos")]
        [XmlArrayItem("signInfos")]
        public List<signInfo> signInfos { get; set; }
    }

    public class signInfo 
    {
        [XmlAttribute("enName")]
        public string enName { get; set; }
        [XmlAttribute("cnName")]
        public string cnName { get; set; }
        [XmlAttribute("pid")]
        public string pid { get; set; }
        [XmlAttribute("id")]
        public string id { get; set; }
        [XmlElement("type")]
        public string type { get; set; }
        [XmlElement("sign")]
        public string sign { get; set; }
        [XmlIgnore]
        public string condition { get; set; }
        [XmlElement("condition",typeof(CDATA))]
        public CDATA conditionCDATA 
        {
            get 
            {
                return new CDATA(condition);
            }
            set 
            {
                condition = value.InnerXML;
            }
        }
        [XmlIgnore]
        public string constraint { get; set; }
        [XmlElement("constraint", typeof(CDATA))]
        public CDATA constraintCDATA
        {
            get
            {
                return new CDATA(constraint);
            }
            set
            {
                constraint = value.InnerXML;
            }
        }
        [XmlElement("showType")]
        public string showType { get; set; }
        [XmlElement("isShow")]
        public string isShow { get; set; }
        [XmlElement("orderNumber")]
        public string orderNumber { get; set; }
        [XmlElement("defaultValue")]
        public string defaultValue { get; set; }
    }

    public class Menu 
    {
        [XmlAttribute("name")]
        public string name { get; set; }
        [XmlAttribute("pid")]
        public string pid { get; set; }
        [XmlAttribute("id")]
        public string id { get; set; }
        [XmlElement("type")]
        public string type { get; set; }
        [XmlElement("isShow")]
        public string isShow { get; set; }
        [XmlElement("showNumber")]
        public string showNumber { get; set; }
        [XmlArray("menuNodes")]
        [XmlArrayItem("menuNode")]
        public List<MenuNode> menuNodes { get; set; }
    }

    public class MenuNode 
    {
        [XmlAttribute("name")]
        public string name { get; set; }
        [XmlAttribute("pid")]
        public string pid { get; set; }
        [XmlAttribute("id")]
        public string id { get; set; }
        [XmlElement("uri")]
        public string uri { get; set; }
        [XmlElement("isShow")]
        public string isShow { get; set; }
        [XmlElement("showNumber")]
        public string showNumber { get; set; }
    }

    public class Controller 
    {
        [XmlAttribute("enName")]
        public string enName { get; set; }
        [XmlAttribute("cnName")]
        public string cnName { get; set; }
        [XmlAttribute("entityId")]
        public string entityId { get; set; }
        [XmlAttribute("pid")]
        public string pid { get; set; }
        [XmlAttribute("id")]
        public string id { get; set; }
        [XmlIgnore]
        public string path { get; set; }
        [XmlElement("path", typeof(CDATA))]
        public CDATA pathCDATA 
        {
            get 
            {
                return new CDATA(path);
            }
            set
            {
                path = value.InnerXML;
            }
        }
        [XmlElement("domainPath")]
        public string domainPath { get; set; }
        [XmlIgnore]
        public string desc { get; set; }
        [XmlElement("desc", typeof(CDATA))]
        public CDATA descCDTA
        {
            get {
                return new CDATA(desc);
            }
            set 
            {
                desc = value.InnerXML;
            }
        }
        [XmlArray("methods")]
        [XmlArrayItem("method")]
        public List<method> methods { get; set; }
    }

    public class method 
    {
        [XmlAttribute("cnName")]
        public string cnName { get; set; }
        [XmlAttribute("pid")]
        public string pid { get; set; }
        [XmlAttribute("id")]
        public string id { get; set; }
        [XmlElement("methodName")]
        public string methodName { get; set; }
        [XmlElement("type")]
        public string type { get; set; }
        [XmlIgnore]
        public string methodDesc { get; set; }
        [XmlElement("methodDesc", typeof(CDATA))]
        public CDATA methodDescCDATA
        {
            get 
            {
                return new CDATA(methodDesc);
            }
            set 
            {
                methodDesc = value.InnerXML;
            }
        }
    }
}
